<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>在线预订设置</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/pravate/common.css" />
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/jquery-2.1.0.js"></script>
		<script type="text/javascript" src="../js/mobile-detect.min.js" ></script>
		<script type="text/javascript" src="../js/config.js" ></script>
		<script type="text/javascript" src="../js/common.js"></script>
	</head>
	<style>
		.warpper{
			padding: 10px;
			margin: 0;
		}
		.warpper-item{
			display: flex;
			background: #fff;
			border-radius: 5px;
			overflow: hidden;
			margin-bottom: 10px;
		}
		.warpper-item .img{
			padding: 20px 10px;
		}
		.warpper-item img{
			width: 45px;
			height: 45px;
			border-radius: 22.5px;
			overflow: hidden;
		}
		.info{
			padding: 25px 0;
			flex: 1;
		}
		.info p{
			font-size: 14px;
			color: #333333;
			line-height: 14px;
			margin-bottom: 10px;
		}
		.right{
			width: 60px;
			line-height: 90px;
			text-align: center;
			color: #fff;
			background: #2F81D2;
		}
	</style>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title title">在线预订设置</h1>
		</header>
		<div class="mui-content">
			<ul class="warpper">
				<script type="text/template" id="listTemple">
					{{each data as value i}}
					<li class="warpper-item">
						<div class="img">
							<img src="{{value.d_picture}}"/>
						</div>
						<div class="info">
							<p>特价房</p>
							<p style="margin: 0;">状态：<span>{{value.isOpen}}</span></p>
						</div>
						<div class="right" data-id='{{value.roomclass_id}}' data-name='{{value.name}}' data-status='{{value.isOpen}}'>
							设置
						</div>
					</li>
					{{/each}}
				</script>
			</ul>
		</div>
		<script type="text/javascript" src="../js/template-web.js"></script>
		<script>
			var data={
				code: 0,
				data:[]
			}
			require(weburl + BookingRoomClassList, "json", "post", {
				token: localStorage.getItem("token")
			}, function(response) {
				console.log(JSON.stringify(response)); 
				if(response.status==='success'){
					var str = template("listTemple",response);
					$(".warpper").html(str);
				}else{
					var str = template("listTemple",data);
					$(".warpper").html(str);
				}
			},function(){
				var str = template("listTemple",data);
					$(".warpper").html(str);
			})
			// 点击设置跳转至该房型设置页面
			mui('body').on('tap','.right',function(){
				mui.openWindow({
					url: './roomDetail.html',
					id: 'roomDetail.html',
					extras: {
						roomId: $(this).attr('data-id'),
						name: $(this).attr('data-name'),
						status: $(this).attr('data-status')
					}
				})
			})
		</script>
	</body>

</html>